import request from '@/utils/request'
import { getToken } from '@/utils/auth'

export default{
    //登录用户数
    getUserLogin(time){
        return request({
            url:`/user/getUsersLog?beginTime=${time}`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计视频的点击量
    getVideoClickNum(){
        return request({
            url:`/course/videoNum`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计文章点击和点赞量
    getArticleClickAndLike(){
        return request({
            url:`/article/get/getClinksAndLikes`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计成交订单量
    getOrderNum(page_num,page_size){
        return request({
            url:`/order/list?page_num=${page_num}&page_size=${page_size}`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计每个各模块的总点击量
    getModuleNum(){
        return request({
            url:`/user/moduleNums`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计每个月生成订单量
    getMonthlyOrder(year){
        return request({
            url:`/order/get/ordernumMonthly?year=${year}`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计课程学习人数
    getCourseLearnNum(){
        return request({
            url:`/course/get/courseLearnNumbers`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },    

    //统计用户注册总量
    getTotalRegister(){
        return request({
            url:`/user/getUserNum`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计登录设备
    getUserEqu(){
        return request({
            url:`/user/getUsrEqu`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计商品类型库存量
    getGoodsStock(){
        return request({
            url:`/mall/get/typeNumbers`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

    //统计课程分类的视频数量
    getCourseTypeNum(){
        return request({
            url:`/course/getTypeNum`,
            method:'GET',
            headers: {
                'Authorization':getToken()
            }
        })
    },

}